#递归函数案列  函数自己调用自己
#求n的阶乘
#使用while循环实现
result = 1
n= int(input("请输入一个数字"))
while n >= 1:
    result = result * n
    n-=1
print(result)

def diGui(n):
    if n >1:
        return n*diGui(n-1)
    else:
        return 1

print(diGui(5))

goodsList = [{"name":"快乐肥宅水","price":"3.0"},{"name":"茉莉清茶","price":"2.0"},{"name":"红茶","price":"4.0"}]
def searchGoods(goodsName):
    for goods in goodsList:
        if goods["name"] == goodsName:
            return {"status":200, "msg":"商品存在","data":goods}
    return {"status":400,"msg":"商品不存在"}
print(searchGoods("红茶"))
print(searchGoods("绿茶"))